package com.chinatsp.onlineapp.presenter;

import com.chinatsp.onlineapp.base.Config;

import android.content.Context;

import tsp.cn.http.BaseIDao;
import tsp.cn.http.HttpConfig;
import tsp.cn.http.interfac.INetResult;
import tsp.cn.http.tools.T;

/**
 * 检查违章服务是否支持该车牌号
 */
public class QueryViolationDao extends BaseIDao {
	private Context mContext;

    public QueryViolationDao(Context context, INetResult iNetResult) {
        super(context, iNetResult);
        mContext = context;
    }

    /**
     * 得到结果后，对结果处理逻辑
     *
     * @param result
     * @param requestCode
     */
    @Override
    public void onRequestSuccess(String result, int requestCode) {
    	T.showShort(mContext, result);

    }

    /**
     * 检查违章服务是否支持该车牌号
     * @param carNum
     */
    public void getQueryViolation(String carNum) {
        StringBuilder strBuilder = new StringBuilder();
        strBuilder.append(HttpConfig.appendString());
        strBuilder.append(Config.API_QUERY_VIOLATION);
        strBuilder.append(carNum);
        strBuilder.append("/");
        getRequest(strBuilder.toString(), Config.CODE_QUERY_VIOLATION);
    }
}
